//
// Created by Administrator on 2020/10/21.
//

#ifndef O5G_SRC_CCORE_PHY_RF_SRC_RFDEV_H_
#define O5G_SRC_CCORE_PHY_RF_SRC_RFDEV_H_

typedef struct RfDevAdpt
{
    const char* name;
    const char* (* rf_devname)(void* h);
    int (* rf_start_rx_stream)(void* h, int8_t now);
    int (* rf_stop_rx_stream)(void* h);
    void (* rf_flush_buffer)(void* h);
    int8_t (* rf_has_rssi)(void* h);
    float (* rf_get_rssi)(void* h);
    void (* rf_suppress_stdout)(void* h);
    void (* rf_register_error_handler)(void* h, rf_error_handler_t error_handler, void* arg);
    int (* rf_open)(char* args, void** h);
    int (* rf_open_multi)(char* args, void** h, uint32_t nof_channels);
    int (* rf_close)(void* h);
    double (* rf_set_rx_srate)(void* h, double freq);
    double (* rf_set_rx_gain)(void* h, double gain);
    double (* rf_set_tx_gain)(void* h, double gain);
    double (* rf_get_rx_gain)(void* h);
    double (* rf_get_tx_gain)(void* h);
    rf_info_t* (* rf_get_info)(void* h);
    double (* rf_set_rx_freq)(void* h, uint32_t ch, double freq);
    double (* rf_set_tx_srate)(void* h, double freq);
    double (* rf_set_tx_freq)(void* h, uint32_t ch, double freq);
    void (* rf_get_time)(void* h, time_t* secs, double* frac_secs);
    void (* rf_sync_pps)(void* h);
    int (* rf_recv_with_time)(void* h, void* data, uint32_t nsamples, int8_t blocking, time_t* secs, double* frac_secs);
    int (* rf_recv_with_time_multi)(void* h, void** data, uint32_t nsamples, int8_t blocking, time_t* secs, double* frac_secs);
    int (* rf_send_timed)(void* h, void* data, int nsamples, time_t secs, double frac_secs, int8_t has_time_spec, int8_t blocking, int8_t is_start_of_burst, int8_t is_end_of_burst);
    int (* rf_send_timed_multi)(void* h, void** data, int nsamples, time_t secs, double frac_secs, int8_t has_time_spec, int8_t blocking, int8_t is_start_of_burst, int8_t is_end_of_burst);
} S_RfDevAdpt;

#endif //O5G_SRC_CCORE_PHY_RF_SRC_RFDEV_H_
